package ru.averta.notes.service;

import java.io.Serializable;
import java.util.Collection;

import net.sourceforge.safr.core.annotation.Filter;
import net.sourceforge.safr.core.annotation.Secure;
import net.sourceforge.safr.core.annotation.SecureAction;
import ru.averta.notes.domain.User;

import ru.averta.notes.domain.flags.IUserable;

public interface UserableObjectService<T extends IUserable, PK extends Serializable> extends BusinessObjectService<T, PK> {

    T create(@Secure(SecureAction.CREATE) T newInstance);

    @Filter T findByID(PK id);

    void save(@Secure(SecureAction.UPDATE) T transientObject);

    void remove(@Secure(SecureAction.DELETE) T object);
    
    @Filter Collection<T> findAll();

    @Filter Collection<T> findByUser(User user);

    Collection<T> findByCUser();
    
}
